package com.supertimetable.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

import com.supertimetable.activities.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Admin on 2018/1/12.
 */

public class MoreFragment extends Fragment {
    private List<CharSequence> date = null;
    private List<CharSequence> teacherNames = null;
    private ArrayAdapter<CharSequence> eduAdaptor = null;
    private ArrayAdapter<CharSequence> eduAdaptor1 = null;
    private Spinner eduSpinner = null;
    private Spinner eduSpinner1 = null;
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_more, container, false);
        eduSpinner1 = (Spinner) view.findViewById(R.id.spiner02);
        eduSpinner = (Spinner) view.findViewById(R.id.spiner01);
        initTeacherName();
        /*initDate();*/
        return view;
    }
    private void initTeacherName() {

        eduSpinner1.setPrompt("选择教师");
        teacherNames = new ArrayList<CharSequence>();
        teacherNames.add("张三");
        teacherNames.add("李四");
        teacherNames.add("王五");
        teacherNames.add("赵六");
        eduAdaptor1 = new ArrayAdapter<CharSequence>(getActivity(),android.R.layout.simple_list_item_1,teacherNames);
        eduAdaptor1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        eduSpinner1.setAdapter(eduAdaptor1);
    }

   /* private void initDate() {
        eduSpinner.setPrompt("选择日期");
        date = new ArrayList<CharSequence>();
        date.add("2016年第一学期");
        date.add("2016年第二学期");
        date.add("2017年第一学期");
        date.add("2017年第二学期");
        eduAdaptor = new ArrayAdapter<CharSequence>(getActivity(),android.R.layout.simple_list_item_1,date);
        eduAdaptor.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        eduSpinner.setAdapter(eduAdaptor);
    }*/
}
